negotiator
Class ContinuousTimeline

java.lang.Object
  extended by negotiator.Timeline
      extended by negotiator.ContinuousTimeline
Direct Known Subclasses:
PausableContinuousTimeline

public class ContinuousTimeline
extends Timeline

A time line, running from t = 0 (start) to t = 1 (deadline). The timeline renormalizes real time.


Nested Class Summary
 
Nested classes/interfaces inherited from class negotiator.Timeline
Timeline.Type
 
Field Summary
protected  long startTime
           
 
Fields inherited from class negotiator.Timeline
hasDeadline, paused
 
Constructor Summary
ContinuousTimeline(int totalSecs)
          Creates a timeline with a deadline of totalSeconds number of seconds.
 
Method Summary
 double getCurrentTime()
           
 double getElapsedMilliSeconds()
          Gets the elapsed time in seconds.
 double getElapsedSeconds()
          Gets the elapsed time in seconds.
 double getTime()
          Gets the time, running from t = 0 (start) to t = 1 (deadline).
 long getTotalMiliseconds()
          Gets the total negotiation time in miliseconds
 long getTotalSeconds()
          Gets the total negotiation time in seconds
 double getTotalTime()
           
 void printElapsedSeconds()
          Prints time in seconds
 void printTime()
          Prints time, running from t = 0 (start) to t = 1 (deadline).
 
Methods inherited from class negotiator.Timeline
getType, isDeadlineReached, isPaused, pause, resume
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startTime

protected final long startTime
Constructor Detail

ContinuousTimeline

public ContinuousTimeline(int totalSecs)
Creates a timeline with a deadline of totalSeconds number of seconds.

Method Detail

getElapsedSeconds

public double getElapsedSeconds()
Gets the elapsed time in seconds. Use getTime() for a more generic version.


getElapsedMilliSeconds

public double getElapsedMilliSeconds()
Gets the elapsed time in seconds. Use getTime() for a more generic version.


getTotalMiliseconds

public long getTotalMiliseconds()
Gets the total negotiation time in miliseconds


getTotalSeconds

public long getTotalSeconds()
Gets the total negotiation time in seconds


printElapsedSeconds

public void printElapsedSeconds()
Prints time in seconds


printTime

public void printTime()
Prints time, running from t = 0 (start) to t = 1 (deadline).

Specified by:
printTime in class Timeline

getTime

public double getTime()
Gets the time, running from t = 0 (start) to t = 1 (deadline). The time is normalized, so agents need not be concerned with the actual internal clock. Please use Agent#wait(double) for pausing the agent.

Specified by:
getTime in class Timeline
Returns:
current time in the interval [0, 1].

getTotalTime

public double getTotalTime()
Specified by:
getTotalTime in class Timeline
Returns:
amount of time in seconds, or amount of rounds depending on timeline type.

getCurrentTime

public double getCurrentTime()
Specified by:
getCurrentTime in class Timeline
Returns:
amount of seconds passed, or amount of rounds passed depending on the timeline type.